package com.ticket.service.impl;

import com.ticket.dao.DanceDao;
import com.ticket.dao.SportsDao;
import com.ticket.dao.impl.SportsDaoImpl;
import com.ticket.entity.Contest;
import com.ticket.entity.Drama;
import com.ticket.service.SportsService;
import com.ticket.util.MybatisUtil;
import com.ticket.util.Page;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @author twj
 * @version 8.0
 * @description TODO
 * @date 2023/10/8
 */
public class SportsServiceImpl implements SportsService {
    static SportsDao dd;
    static{
        SqlSession session= MybatisUtil.getSqlSession();
        dd=session.getMapper(SportsDao.class);
    }
    @Override
    public Page<Contest> selSports(Page page, Contest contest) {
        List<Drama> dramaPage= dd.selSports(page, contest);
        int dramaPageCount= dd.selSportsCount(contest);
        page.setTotalCount(dramaPageCount);
        page.setDataList(dramaPage);
        return page;
    }
}
